<template>
	<view class="container">
		<view class="list-cell b-b m-t" @click="navTo('/pages/core/user/avatar')" hover-class="cell-hover" :hover-stay-time="50">
			<text class="cell-tit">头像</text>
			<text class="cell-tip">
				<image :src="user.userInfo.avatar" mode="scaleToFill"></image>
			</text>
			<text class="cell-more xyicon xyicon-right"></text>
		</view>
		<view class="list-cell b-b" hover-class="cell-hover" :hover-stay-time="50">
			<text class="cell-tit">UID</text>
			<text class="cell-tip">{{user.userInfo.id}}</text>
			<text class="cell-more xyicon xyicon-right"></text>
		</view>
		<view class="list-cell" @click="navTo('/pages/core/user/nickname')" hover-class="cell-hover" :hover-stay-time="50">
			<text class="cell-tit">昵称</text>
			<text class="cell-tip">{{user.userInfo.nickname}}</text>
			<text class="cell-more xyicon xyicon-right"></text>
		</view>
		<view class="list-cell" hover-class="cell-hover" :hover-stay-time="50">
			<text class="cell-tit">用户名</text>
			<text class="cell-tip">{{user.userInfo.username}}</text>
			<text class="cell-more xyicon xyicon-right"></text>
		</view>
	</view>
</template>

<script>
	import {mapState, mapMutations} from 'vuex';
	export default {
		data() {
			return {};
		},
		computed: {
			...mapState(['app', 'user'])
		},
		onLoad() {
		},
		methods:{
			navTo(url){
				uni.navigateTo({
					url: url
				})
			}
		}
	}
</script>

<style lang='scss'>
	page {
		background: $page-color-base;
	}
	.list-cell {
		display: flex;
		align-items: center;
		padding: 20upx $page-row-spacing;
		line-height:60upx;
		position:relative;
		background: #fff;
		justify-content: center;
		&.log-out-btn {
			margin-top: 40upx;
			.cell-tit{
				color: $uni-color-primary;
				text-align: center;
				margin-right: 0;
			}
		}
		&.cell-hover {
			background:#fafafa;
		}
		&.b-b:after {
			left: 30upx;
		}
		&.m-t {
			margin-top: 16upx;
		}
		.cell-more {
			align-self: center;
			font-size:$font-lg;
			color:$font-color-light;
			margin-left:10upx;
		}
		.cell-tit {
			flex: 1;
			font-size: $font-base + 2upx;
			color: $font-color-dark;
			margin-right:10upx;
		}
		.cell-tip {
			font-size: $font-base;
			color: $font-color-light;
			image {
				max-width: 120upx;
				max-height: 120upx;
			}
		}
		switch {
			transform: translateX(16upx) scale(.84);
		}
	}
</style>
